'use strict';

/**
 * @param {Egg.Application} app - egg application
 */
module.exports = app => {
  const { router, controller,io } = app;
  router.get('/', controller.home.index);
  router.post('/api/login', controller.home.login); //登录
  router.get('/learnList', controller.home.learnList);  //科普渲染
  router.get('/learnhotList', controller.home.learnhotList);  //科普热点渲染
  router.get('/shopList', controller.home.shopList);  //商城渲染
  router.post('/api/addCart', controller.home.addCart);  //加入购物车
  router.get('/cart', controller.home.cart);  //购物车渲染
  // router.post('/api/carIs', controller.home.carIs);  //购物车全选
  router.post('/cartDel', controller.home.cartDel);  //购物车列表删除
  router.post('/learnCheck', controller.home.learnCheck);  //科普搜索
  io.of('/').route('res', controller.chat.index);  //我的医生聊天室

  //PC-----------------------------------------------------------------------------
  router.post('/pc/login', controller.home.PClogin);  //PC登录
  router.get('/pc/learnhotList', controller.home.PChotList);  //PC科普热点渲染
  router.post('/pc/addhot', controller.home.PCaddhot);  //PC热点增加数据
  router.post('/pc/delhot', controller.home.PCdelhot);  //PC热点删除数据
  router.post('/pc/updatehot', controller.home.PCupdatehot);  //PC热点修改数据
  router.post('/pc/checkhot', controller.home.PCcheckhot);  //PC热点查找数据


  //alipay------------------------------------------------------------------------------------------
  router.get('/alipay', controller.pay.alipay); 







};
